import { IPanelItemProvider, PanelController, PanelItemController } from '@ibiz-template/runtime'
import { IPanelContainer } from '@ibiz/model-core'
import { PanelContainerController } from '../panel-container/i-biz-panel-container.controller'
/**
 * 视图内容区适配器
 *
 * @author chitanda
 * @date 2023-06-16 11:06:38
 * @export
 * @class ViewContentPanelContainerProvider
 * @implements {IPanelItemProvider}
 */
export class ViewContentPanelContainerProvider implements IPanelItemProvider {
  component: string = 'IBizViewContentPanelContainer'

  async createController(
    panelItem: IPanelContainer,
    panel: PanelController,
    parent: PanelItemController | undefined,
  ): Promise<PanelItemController> {
    const c = new PanelContainerController(panelItem, panel, parent)
    await c.init()
    return c
  }
}
